<template>
  <div class="detail">
    <div class="nav">
      <van-nav-bar
        title="标题"
        left-text="返回"
        right-text="按钮"
        left-arrow
        @click-left="onClickLeft"
        @click-right="onToSearch"
      >
        <template #right>
          <van-icon name="search" size="18" />
        </template>
      </van-nav-bar>
    </div>
  </div>
  <div class="pic"></div>
</template>

<script>
import request from "@/utils/request";
export default {
  name: "Detail",
  methods: {
    onClickLeft() {
      this.$router.back();
    },
    onToSearch() {
      this.$router.push({ path: "/search" });
    }
  },
  created() {
    console.log(this.$route.query.id);
    request({
      method: "GET",
      url: "/api/shop/find",
      prames: {
        id: this.$route.query.id
      }
    }).then(data => {
      console.log(data);
    });
  }
};
</script>

<style lang="less" scoped>
.nav {
  width: 100%;
  height: 50px;
  position: fixed;
}
.pic {
  width: 375px;
  height: 375px;
  img {
    width: 100%;
    height: 100%;
  }
}
</style>
